'''
Created on 08/06/2010

@author: Will
'''
from  pyglet.window import key
from objects.realRoundObject  import RealRoundObject
from pymunk import Vec2d
class Pc(RealRoundObject):
    
    def __init__(self,x,y,rot):
        RealRoundObject.__init__(self, x, y,"player.png",70)
       
        
    def tick(self,keyboard):
        self.physicsUpdate()    
        
        
        if(keyboard[key.UP]):
            self.body.apply_impulse((0,700),self.getRotatedTopPoint() )
        if(keyboard[key.DOWN]):
            self.body.apply_impulse((0,-700),self.getRotatedTopPoint() )
        if(keyboard[key.LEFT]):
            self.body.apply_impulse((-700,0),self.getRotatedTopPoint() )
        if(keyboard[key.RIGHT]):
            self.body.apply_impulse((700,0),self.getRotatedTopPoint() )
        
        for i in self.childs:
            i.tick()